import request from '@/config/axios'

// 会员等级管理 VO
export interface BusinessCreditVO {
  id: number // 编号
  name: string // 信用等级名称
  level: number // 信用等级
  experience: number // 升级经验
  icon: string // 信用等级图标
  backgroundUrl: string // 信用等级背景图
  status: number // 状态
  institution: string //制度
  price:  number //价格
}

// 会员等级管理 API
export const BusinessCreditApi = {
  // 查询会员等级管理分页
  getBusinessCreditPage: async (params: any) => {
    return await request.get({ url: `/wine/business-credit/page`, params })
  },

  // 查询会员等级管理详情
  getBusinessCredit: async (id: number) => {
    return await request.get({ url: `/wine/business-credit/get?id=` + id })
  },

  // 新增会员等级管理
  createBusinessCredit: async (data: BusinessCreditVO) => {
    return await request.post({ url: `/wine/business-credit/create`, data })
  },

  // 修改会员等级管理
  updateBusinessCredit: async (data: BusinessCreditVO) => {
    return await request.put({ url: `/wine/business-credit/update`, data })
  },

  // 删除会员等级管理
  deleteBusinessCredit: async (id: number) => {
    return await request.delete({ url: `/wine/business-credit/delete?id=` + id })
  },

  // 导出会员等级管理 Excel
  exportBusinessCredit: async (params) => {
    return await request.download({ url: `/wine/business-credit/export-excel`, params })
  }
}
